package com.jq.aution.service.impl;

import com.jq.aution.mapper.UserAccountInfoMapper;
import com.jq.aution.model.ProductInfo;
import com.jq.aution.model.UserAccountInfo;
import com.jq.aution.model.UserAccountInfoExample;
import com.jq.aution.service.UserAccountInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserAccountInfoServiceImpl implements UserAccountInfoService {
    private static final Logger LOGGER = LoggerFactory.getLogger(UserAccountInfoServiceImpl.class);
    @Autowired
    UserAccountInfoMapper userAccountInfoMapper;

    @Override
    public UserAccountInfo loadUserAccountInfoById(Integer id) {
        UserAccountInfoExample example=new UserAccountInfoExample();
        example.createCriteria().andUserIdEqualTo(id);
        UserAccountInfo userAccountInfo=null;
        try {
            userAccountInfo=userAccountInfoMapper.selectByExample(example).get(0);
        }catch (Exception e){
            LOGGER.error("获取用户账户信息出错"+e.getMessage());
        }
        return userAccountInfo;
    }
}
